package cn.lhl.mvc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;

/**
 * Created by Administrator on 2017/4/1/001.
 */
public class ServletActionContext {
    private static HttpServletRequest request;
    private static HttpServletResponse response;

    public static HttpServletResponse getResponse() {
        return response;
    }

    public static void setResponse(HttpServletResponse response) {
        response.setCharacterEncoding("utf-8");
        ServletActionContext.response = response;
    }

    public static HttpServletRequest getRequest() {
        return request;
    }

    public static void setRequest(HttpServletRequest request) throws UnsupportedEncodingException {
        request.setCharacterEncoding("utf-8");
        ServletActionContext.request = request;
    }
}
